package com.pubg.information.controller;

import com.alibaba.fastjson.JSONObject;
import com.pubg.information.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class CommentController {

    @Autowired
    CommentService commentService;

    @ResponseBody
    @RequestMapping("/comment")
    public Map insComment(@RequestBody JSONObject json){
        Map map = new HashMap();
        map.put("comment",commentService.insComment(json));
        return  map;
    }
}
